package com.boat.ai.rag.Ingestion;

import dev.langchain4j.data.document.Document;
import dev.langchain4j.data.document.DocumentSplitter;
import dev.langchain4j.data.document.splitter.DocumentSplitters;
import dev.langchain4j.data.segment.TextSegment;

import java.util.List;

public class FixedSplitter implements Split {
    @Override
    public List<TextSegment> split(List<Document> documents) {
        DocumentSplitter splitter = DocumentSplitters.recursive(500, 50); // max segment size = 500 tokens, 50 token overlap
        return splitter.splitAll(documents);
    }
}
